local skel = fk.CreateSkill {
  name = "emo__dangjing",
}

skel:addEffect("viewas", {
  anim_type = "offensive",
  prompt = "#emo__dangjing",
  card_filter = Util.FalseFunc,
  view_as = function (self)
    local c = Fk:cloneCard("emo__enemy_at_the_gates")
    c.skillName = skel.name
    return c
  end,
  after_use = function(self, player, use)
    local room = player.room
    if player.dead then return end
    -- 耦合判断一下是否使用杀造成伤害
    if not (use.extra_data and use.extra_data.enemy_at_the_gates_damageInfo and #use.extra_data.enemy_at_the_gates_damageInfo > 0) then
      local targets = (use.tos)
      room:sortByAction(targets)
      for _, from in ipairs(targets) do
        if not from.dead and not player.dead then
          room:useVirtualCard(use.card.name, nil, from, player, skel.name)
        end
      end
    end
  end,
  enabled_at_play = function(self, player)
    return player.phase == Player.Play and player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  enabled_at_response = Util.FalseFunc,
})

Fk:loadTranslationTable{
  ["emo__dangjing"] = "荡境",
  [":emo__dangjing"] = "出牌阶段限一次，你可以视为使用一张【兵临城下】，然后若你未因此造成伤害，目标角色视为对你使用一张【兵临城下】。",
  ["#emo__dangjing"] = "荡境：视为使用【兵临城下】，若未造成伤害，目标视为对你使用【兵临城下】",

  ["$emo__dangjing1"] = "不聘千里，不奋六翮，盖予生而有之。",
  ["$emo__dangjing2"] = "九川刮泥而成岛屿，不刮民何以成家国。",
}


return skel
